package com.mark.web.sys.service.impl;

import com.mark.common.Constant;
import com.mark.common.ServerResponse;
import com.mark.web.sys.entity.po.Resource;
import com.mark.web.sys.mapper.ResourceMapper;
import com.mark.web.sys.service.IResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: 系统资源接口实现类
 * @Author: Mark
 * @CreateDate: 2019/1/13 23:03
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
@Service
public class ResourceServiceImpl implements IResourceService {
    @Autowired
    private ResourceMapper resourceMapper;

    @Override
    public ServerResponse<String> addResource(Resource resource) {
        int insert = resourceMapper.insert(resource);
        if(insert == Constant.SUCCESS){
            return ServerResponse.createBySuccess();
        }
        return ServerResponse.createByErrorMessage("保存数据失败！");
    }

}
